/*
 * globalConstants.h
 *
 *  Created on: 15-Sep-2011
 *      Author: prat
 */

#ifndef GLOBALCONSTANTS_H_
#define GLOBALCONSTANTS_H_

#include "globalHeaders.h"
#include "pageSize.h"

// known data types
#define LONG_SIZE 8
#define INT_SIZE 4
#define SHORT_SIZE 2
#define KB 1024
#define MAX_VARCHAR 100
#define CHAR 1
//our datatypes
#define FRAME_SIZE 8205 //8192+14-1=8205 where 14 is size of frameStruct
#define PAGE_SIZE 8192
#define TABLE_NAME 20
#define DB_NAME 20
#define MAX_FREE_SPACE (PAGE_SIZE - (INT_SIZE + sizeof(dbModule::slotEntry)))
#define MAX_NOS_COLUMNS 15 //is it fine?


// no. of DEs
#define PAGE_PRIORITY 4
#define PAGE_NUMBER 8
#define PAGE_NEXT_POINTER 8
#define PAGE_CFS 4
#define PAGE_DATA 1
#define DP_NUM_CURRENT_DES 4
#define DP_NEXT_POINTER 8
#define DP_MAX_NOS_DES 678 // (pagesize - priority - pageNumber - nextPage - CFS - pageData - noOfCurrentDEs - ptrToNextDP ) / (TFS + pointerToDBPage)( 8192 - 4 - 8 - 8 - 4 - 1 - 4 - 8 ) / 12
// to keep count of how many table entries are made in the systable

//pageData size = size of DP
// pagesize - priority - pageNumber - nextPage - cfs - pageData = 8192 - 4 - 8 - 8 - 4 - 1

#define SUCCESS 1
#define FAILURE 0

// J: BplusTree
#define NUM_OF_DATATYPES 8
#define PAGEDATA_SIZE  (8192 - 4 - 8 - 8 - 4)
#define POINTER_SIZE 8
//PAGESIZE-sizeof((dbModule::dirPage)-1)

// return flags
//#define SUCCESS 0
//#define FAILURE 1

// debug flag
#define DEBUG false
#endif /* GLOBALCONSTANTS_H_ */
